package psn.qiuyiping.autocad.dxffile;

import java.lang.reflect.Member;
import java.util.Map;

public class DxfEntity extends DxfObject {
    final static Map<Integer, Member> FIELDS;
    static {
        FIELDS = redo(DxfObject.class);
        FIELDS.putAll(redo(DxfEntity.class));
    }
    
    @DxfCode(62)
    int colorIndex;
    @DxfCode(210)
    double[] dir_extru;
    DxfLayer layer;
    @DxfCode(370)
    int ltWeight;
    DxfLType ltype;
    @DxfCode(48)
    double ltypeScale = 1.0;
    @DxfCode(39)
    double thickness;
    boolean visible = true;

    @Override
    public Map<Integer, Member> initFields(){
        return new java.util.TreeMap<>(FIELDS);
    }
    
    @DxfCode(8)
    public void readLayer(DxfProcessContext context, DxfData<String> item) {
        layer = context.getFile().getLayer(item.getVal());
    }
    
    @DxfCode(6)
    public void readLType(DxfProcessContext context, DxfData<String> item) {
        ltype = context.getFile().getLType(item.getVal());
    }
    
    @DxfCode(60)
    public void readVisible(DxfProcessContext context, DxfData<Short> item) {
        visible =item.getVal() == 0;
    }
}
